"""meiduo URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include

from django.http import HttpResponse
# def logss(request):
#     return HttpResponse('666')
#
# import logging
# myl=logging.getLogger('django')
# myl.info('这是日志器info')
# myl.error('这是日志器error')

# 注册自定义转换器
from django.urls import register_converter
from utils.converters import UserNameIntConverter, MobileIntConverter,ImageCodeIdConverter

register_converter(UserNameIntConverter, 'username')
register_converter(MobileIntConverter, 'mobile')
register_converter(ImageCodeIdConverter,'UUID')

urlpatterns = [
    path('admin/', admin.site.urls),
    # path('mylog/', logss),
    path('', include('apps.users.urls')),
    path('', include('apps.verification.urls')),
    path('', include('apps.oauth.urls')),
    path('', include('apps.areas.urls')),
    path('', include('apps.goods.urls')),
    path('', include('apps.carts.urls')),
    path('', include('apps.orders.urls')),
    path('', include('apps.payment.urls')),
    path('meiduo_admin/', include('apps.wthg_admin.urls')),
]
